package com.movie.service.Impl;

import com.movie.beans.Rating;
import com.movie.dao.RateDAO;
import com.movie.service.RateService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RateServiceImpl implements RateService {
    @Resource
    private RateDAO rateDAO;
    @Override
    public List<Rating> selectRatingByMovieId(Long movieId) {
        return rateDAO.selectRatingByMovieId(movieId);
    }

    @Override
    public Double selectRatingAvgByMovieId(Long movieId) {
        return rateDAO.selectRatingAvgByMovieId(movieId);
    }

    @Override
    public int insert(Rating rating) {
        return rateDAO.insert(rating);
    }

    @Override
    public List<Rating> selectRatingList(Rating rating) {
        return rateDAO.selectRatingList(rating);
    }

    @Override
    public int deleteRating(Rating rating) {
        return rateDAO.deleteRating(rating);
    }

    @Override
    public Rating selectRating(Rating rating) {
        return rateDAO.selectRating(rating);
    }
}
